import requests

if __name__ == "__main__":
    url = "http://125.35.6.84:81/xk/itownet/portalAction.do?method=getXkzsList"
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36',
    }
    param = {
        "on": "true",
        "page": "1",
        "pageSize": "15",
        "productName": "",
        "conditionType": "1",
        "applyname": "",
        "applysn": ""
    }
    response = requests.post(url=url, headers=headers, data=param)
    json_data = response.json()
    # print(json_data)

    id_list = []
    for dict in json_data["list"]:
        id = dict["ID"]
        id_list.append(id)

    post_url = 'http://125.35.6.84:81/xk/itownet/portalAction.do?method=getXkzsById'

    for id in id_list:
        post_data = {
            'id': id
        }
        response = requests.post(url=post_url, data=post_data, headers=headers)
        print(response.json())
